TEMPLATE = app
CONFIG += console
QT -= core gui

unix {
    # add "_bin" to target filename
    TARGET = $${TARGET}_bin
}

unix : !macx {
    LIBS += -lglut -lGLU -lGL -lm
}

macx {
    QT += opengl
    CONFIG -= app_bundle
    LIBS += -framework GLUT
}

win32 {
    # add GLUT includes and library (dynamically linked)
    GLUTDIR = ..\common\freeglut\windows
    INCLUDEPATH += $$GLUTDIR/include
    LIBS += $$GLUTDIR/lib/libfreeglut.a

    # copy GLUT DLL into the output directory
    GLUTDLL = $$GLUTDIR\lib\freeglut.dll
    glutdll_debug.target = debug\freeglut.dll
    glutdll_debug.commands = copy $$GLUTDLL debug
    glutdll_release.target = release\freeglut.dll
    glutdll_release.commands = copy $$GLUTDLL release
    QMAKE_EXTRA_TARGETS += glutdll_debug glutdll_release
    POST_TARGETDEPS += debug\freeglut.dll release\freeglut.dll

    LIBS += -lopengl32 -lglu32
}

HEADERS += ../common/cg_common.h
